check also the byte position against the limit.
+2006-11-17 NIIMI Satoshi <sa2c@sa2c.net> (tiny change)
+
+ * search.c (simple_search): In the loop of backward searching,
+ check also the byte position against the limit.
+
2006-11-14 Romain Francoise <romain@orebokech.com>
* minibuf.c (Fcompleting_read): Fix typo in docstring.
int this_len_byte = len_byte;
unsigned char *p = pat;
- if (pos - len < lim)
+ if (this_pos < lim || this_pos_byte < lim_byte)
goto stop;
while (this_len > 0)